export default function generateMap<T extends Recordable<LabelValuePair>, K extends keyof T>(
  obj: T
) {
  const _obj: any = {};
  const arr: LabelValuePair[] = [];
  for (const key in obj) {
    _obj[key] = obj[key].value;
    _obj[obj[key].value] = obj[key].label;
    arr.push(obj[key]);
  }
  _obj._All = arr;
  return _obj as Record<keyof T | T[K]["value"] | "_All", string | number>;
}
